<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}工具箱{% endblock %} - 软测工具箱</title>
    
    <!-- Bootstrap CSS (本地) -->
    <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
    <!-- Font Awesome (本地) -->
    <link href="{{ url_for('static', filename='css/fontawesome-all.min.css') }}" rel="stylesheet">
    <!-- 自定义CSS -->
    <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
    
    {% block extra_css %}{% endblock %}
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container-fluid">
            <a class="navbar-brand" href="{{ url_for('main.index') }}">
                <i class="fas fa-toolbox"></i> JYB工具箱
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('main.index') }}">
                            <i class="fas fa-home"></i> 首页
                        </a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                            <i class="fas fa-tools"></i> 工具
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="{{ url_for('tools.excel_to_word') }}">
                                <i class="fas fa-file-export"></i> Excel导出测试文档
                            </a></li>
                            <!-- 暂时停用 PDF转Word -->
                            <!-- <li><a class="dropdown-item" href="{{ url_for('tools.pdf_to_word') }}">
                                <i class="fas fa-file-pdf"></i> PDF转Word
                            </a></li> -->
                            <!-- 暂时停用 编码转换 -->
                            <!-- <li><a class="dropdown-item" href="{{ url_for('tools.encoding_converter') }}">
                                <i class="fas fa-exchange-alt"></i> 编码转换
                            </a></li> -->
                            <li><a class="dropdown-item" href="{{ url_for('tools.doc_replace') }}">
                                <i class="fas fa-edit"></i> 文档批量替换
                            </a></li>
                        </ul>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('main.help') }}">
                            <i class="fas fa-question-circle"></i> 帮助
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('main.about') }}">
                            <i class="fas fa-info-circle"></i> 关于
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <main class="container my-4">
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
                        {{ message }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        
        {% block content %}{% endblock %}
    </main>

    <!-- 页脚 -->
    <footer class="bg-light text-center text-muted py-3 mt-5">
        <div class="container">
            <p class="mb-0">© 2025 JYB工具箱 - 用代码提效（金御博-软测）</p>
        </div>
    </footer>

    <!-- Bootstrap JS (本地) -->
    <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
    <!-- jQuery (本地) -->
    <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
    <!-- 自定义JS -->
    <script src="{{ url_for('static', filename='js/main.js') }}"></script>
    
    {% block extra_js %}{% endblock %}
</body>
</html>

